package com.cy.pj.sys.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cy.pj.common.bo.PageObject;
import com.cy.pj.common.vo.JsonResult;
import com.cy.pj.sys.pojo.SysLog;
import com.cy.pj.sys.service.SysLogService;

@Controller
@RequestMapping("/log/")
public class SysLogController {
	@Autowired
	private SysLogService sysLogService;
	@RequestMapping("doDeleteObjects")
	@ResponseBody
	public JsonResult doDeleteObject(Integer...ids) {
		sysLogService.deleteObjects(ids);
		return new JsonResult("删除成功");
	}
	
	@RequestMapping("doFindPageObjects")
	@ResponseBody
	public JsonResult  doFindPageObjects(String username,Integer pageCurrent){
	PageObject<SysLog> pageObject = sysLogService.findPageObjects(username,pageCurrent);
	 //控制层对业务数据再次封装
	 //方法1
	 //JsonResult
	return new JsonResult(pageObject);
	//此值会返回给DispatcherServlet对象
	//DispatcherServlet对象会将JsonResult转换成Json格式的字符串 然后响应到客户端
	//转换过程是DispatcherServlet(springmvc核心对象)调用了jackson api 来实现的
	}

}


